div.listingblock(id=node.$id(),class=node.$role())
  if node.$title() != false
    div.title !{node.$captioned_title()}
  div.content
    - var nowrap = !(node.document.$attr("prewrap",false)) || node['$option?']('nowrap')
    if node.$style() == "source" || (node.$style() == 'listing' && node.$attr(1, 'listing'))
      - language = node.$attr('language',false)
      - var code_class = language ? [language, "language-#{language}"] : ""
      - var pre_class = ['highlight']
      - var pre_lang = ""
      case node.$attr("source-highlighter")
        when "coderay"
          - pre_class = ['CodeRay']
        when 'pygments'
          - pre_class = ['pygments','highlight']
        when 'prettify'
          - pre_class = ['prettyprint']
          - pre_class.push(node.$attr("linenums",''));
          - pre_class.push(language ? language : '');
          - pre_class.push(language ? "language-#{language}" : '');
        when 'html-pipeline'
          - pre_lang = language
          - pre_class = code_class = ''
          - nowrap = false
      - pre_class.push(nowrap ? nowrap : '')
      pre(class=pre_class,lang=pre_lang)
        code(class=[code_class]) !{node.$content()}
    else
      pre(class=nowrap ? "nowrap" : "") !{node.$content()}